package counter;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import counter.count.Count;
import counter.count.RegularExpression;


public class Counter {
	public int numberCount = 0;
	public int alphaCount = 0;
	public int chineseCount = 0;
	public int punctuationCount = 0;
	
	public void counter(){
		Scanner scanner;
		Count count = new Count();
		try {
			scanner = new Scanner(new File("counter.txt"));
			while (scanner.hasNext()){
				String string= scanner.nextLine();
//				System.out.println(string);
				numberCount += count.count(RegularExpression.NUMBER, string);
				alphaCount += count.count(RegularExpression.ALPHA, string);
				chineseCount += count.count(RegularExpression.CHINESE, string);
				punctuationCount += count.count(RegularExpression.PUNCTUATION, string);
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.println(numberCount);
		System.out.println(alphaCount);
		System.out.println(chineseCount);
		System.out.println(punctuationCount);

	}	
}
